package demo1;

public class Test {
    public static void main(String[] args) {
        test1();
        test2();
        test3();
        test4();
    }

    public static void test1() {
        Student student1 = new Student("zhangsan",18,99);
        Student student2 = new Student("lisi",20,60);
        if (student1.compareTo(student2) > 0) {
            System.out.println("student1.age > student2.age");
        }else if(student1.compareTo(student2) < 0) {
            System.out.println("student1.age < student2.age");
        }else   System.out.println("student1.age = student2.age");

    }

    public static void test2() {
        Student student3 = new Student("zhangsan",21,99);
        Student student4 = new Student("lisi",20,60);
        AgeCompare ageCompare = new AgeCompare();
        if(ageCompare.compare(student3,student4)>0){
            System.out.println("student3.age > student4.age");
        }else if(ageCompare.compare(student3,student4)<0) {
            System.out.println("student3.age < student4.age");
        }
    }
    public static void test3() {
        Student student5 = new Student("zhangsan",21,91.1);
        Student student6 = new Student("lisi",20,91.2);
        ScoreCompare scoreCompare = new ScoreCompare();
        if(scoreCompare.compare(student5,student6)>0){
            System.out.println("student5.score > student6.score");
        }else if(scoreCompare.compare(student5,student6)<0) {
            System.out.println("student5.score < student6.score");
        }
    }
    public static void test4() {
        Student student7 = new Student("zhangsan",21,91.1);
        Student student8 = new Student("lisi",20,91.2);
        NameCompare nameCompare = new NameCompare();
        if(nameCompare.compare(student7,student8)>0){
            System.out.println("student7.name > student8.name");
        }else if(nameCompare.compare(student7,student8) < 0) {
            System.out.println("student7.name < student8.name");
        }
    }
}
